# 加文件名前缀,修改文件名后缀
Get-ChildItem -r (Get-Location).Path -Filter *.svg |
ForEach-Object {
	Rename-Item $_.FullName -NewName ('customized-'+$_.BaseName+'.vue')
}
# 修改文件内容
Get-ChildItem -r (Get-Location).Path -Filter *.vue |
Foreach-Object {
	# 获取文件内容并替换"<svg "为指定开头
	(Get-Content $_.FullName) -Replace "<svg ","<template>
	<svg :style='{width:width,height:height,fontSize:fontSize}' aria-hidden='true'
	" | Set-Content $_.FullName;
	# 替换无用的xmlns:xlink='http://www.w3.org/1999/xlink'头信息
	(Get-Content $_.FullName) -Replace " xmlns:xlink='http://www.w3.org/1999/xlink'","" | Set-Content $_.FullName;
	# 在文件末尾追加
	"</template>
<script setup lang='ts'>
const props = defineProps({
	width    : { type : String, require : false, default : '1em' },
	height   : { type : String, require : false, default : '1em' },
	fontSize : { type : String, require : false, default : 'inherit' }
});
</script>" | Add-Content $_.FullName;
}